﻿//++
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// Module Name:
//
//    EnhancedRemindersExceptions.cs
//
// Abstract:
//    
//    Defines exceptions specific to Enhanced Reminders/
//
//--

using System;
using System.Runtime.Serialization;

namespace Microsoft.EnhancedReminders
{
    /// <summary>
    /// Simple exception class representing a failure to deliver an instant message.
    /// This is intended for implementations of IMessageSender to throw
    /// if they run into delivery errors so that they aren't tied to a specific assembly.
    /// </summary>
    [Serializable]
    public class InstantMessageDeliveryFailureException : Exception, ISerializable
    {
        /// <summary>
        /// Default ctor.
        /// </summary>
        public InstantMessageDeliveryFailureException()
            : base()
        {
        }

        /// <summary>
        /// ctor.
        /// </summary>
        /// <param name="message">A message describing the cause of the error</param>
        /// <param name="inner">The exception that this exception wraps.</param>
        public InstantMessageDeliveryFailureException(string message, Exception inner) :
            base(message, inner)
        {
        }

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="message">A message describing the cause of the error</param>
        public InstantMessageDeliveryFailureException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// ctor.
        /// </summary>
        protected InstantMessageDeliveryFailureException(SerializationInfo info,
                    StreamingContext context) :
            base(info, context)
        {
        }

        #region ISerializable Members

        /// <summary>
        /// ISerializable.GetObjectData
        /// </summary>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }

        #endregion
    }

    /// <summary>
    /// Simple exception class representing a failure to deliver an appINVITE.
    /// </summary>
    [Serializable]
    public class AppInviteDeliveryFailureException : Exception, ISerializable
    {
        /// <summary>
        /// Default ctor.
        /// </summary>
        public AppInviteDeliveryFailureException()
            : base()
        {
        }

        /// <summary>
        /// ctor.
        /// </summary>
        /// <param name="message">A message describing the cause of the error</param>
        /// <param name="inner">The exception that this exception wraps.</param>
        public AppInviteDeliveryFailureException(string message, Exception inner) :
            base(message, inner)
        {
        }

        /// <summary>
        /// ctor
        /// </summary>
        /// <param name="message">A message describing the cause of the error</param>
        public AppInviteDeliveryFailureException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// ctor.
        /// </summary>
        protected AppInviteDeliveryFailureException(SerializationInfo info,
                    StreamingContext context) :
            base(info, context)
        {

        }

        #region ISerializable Members

        /// <summary>
        /// ISerializable.GetObjectData
        /// </summary>
        public override void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            base.GetObjectData(info, context);
        }

        #endregion
    }
}
